home *** CD-ROM | disk | FTP | other *** search
/ Ahoy 1989 February / Ahoy_Magazine_89-02_1989_Double_L.d64 / Word Order (.txt) < prev   
Commodore BASIC  |  2022-10-26  |  434b  |  14 lines

  1. 0 print"[147]"tab(14)"word order"
  2. 1 rem ==================================
  3. 2 rem    commodares problem #58-4 :
  4. 3 rem       word order
  5. 4 rem    solution by
  6. 5 rem       carlos centeno
  7. 6 rem ==================================
  8. 10 input "enter 2 words";a$(1),a$(2): print
  9. 20 for x=1 to 2: z=65
  10. 30 for y=1 to len(a$(x))
  11. 40 if mid$(a$(x),y,1)=chr$(z) then b$(x)=b$(x)+mid$(a$(x),y,1)
  12. 50 next y: if len(b$(x))<>len(a$(x)) then z=z+1: goto 30
  13. 60 next x: print a$((b$(1)<b$(2))+2)" is first."
  14.